package test00.lx05.test01;

import java.util.Arrays;
import java.util.function.Supplier;

/**
 * @author CSY
 * @date 2025 - 04 - 02
 */
public class MainTest02 {
    public static void main(String[] args) {
        Student[] stus = {
                new Student("张三",18),
                new Student("李四",16),
                new Student("王五",14),
                new Student("赵六",20),
                new Student("小七",21),
        };
        Supplier<Student> supplier = () -> {
            Arrays.sort(stus,(o1,o2) -> o1.getAge() - o2.getAge());
            return stus[0];
        };
        Student student = supplier.get();
        System.out.println(student.getName() + "-" + student.getAge());

    }
}
